/*
 test for standard primitives: and, or, xor, nor, nand, xnor 
*/

module cucu;

wire  out;
reg  in, en;

wire [1:0] out2;
reg [1:0] in2, en2;

bufif0 b (out, in, en);

bufif0 b2 [1:0] (out2, in2, en2);

initial begin

$display("single bufif0:");
$display("out\t\t\tin\ten\n----------------------------------------------------"); 
$strobe("%v \t%b\t%b", out, in, en);

in = 0;
en = 0;
#1 en = 1;
$strobe("%v \t%b\t%b", out, in, en);
#1 en = 'bx;
$strobe("%v \t%b\t%b", out, in, en);
#1 en = 'bz;
$strobe("%v \t%b\t%b", out, in, en);
#1 in = 1;
en = 0;
$strobe("%v \t%b\t%b", out, in, en);
#1 en = 1;
$strobe("%v \t%b\t%b", out, in, en);
#1 en = 'bx;
$strobe("%v \t%b\t%b", out, in, en);
#1 en = 'bz;

$strobe("%v \t%b\t%b", out, in, en);
#1 in = 'bx;
en = 0;
$strobe("%v \t%b\t%b", out, in, en);
#1 en = 1;
$strobe("%v \t%b\t%b", out, in, en);
#1 en = 'bx;
$strobe("%v \t%b\t%b", out, in, en);
#1 en = 'bz;
$strobe("%v \t%b\t%b", out, in, en);

#1 in = 'bz;
en = 0;
$strobe("%v \t%b\t%b", out, in, en);
#1 en = 1;
$strobe("%v \t%b\t%b", out, in, en);
#1 en = 'bx;
$strobe("%v \t%b\t%b", out, in, en);
#1 en = 'bz;
$strobe("%v \t%b\t%b", out, in, en);
#1;

//======================================

$display("\nbufif0 array:\n");
$display("out2\t\t\t\t\tin2\ten2\n----------------------------------------------------"); 
$strobe("%v \t%b\t%b", out2, in2, en2);

in2 = 'b00;
en2 = 'b00;
#1 en2 = 'b11;
$strobe("%v \t%b\t%b", out2, in2, en2);
#1 en2 = 'bxx;
$strobe("%v \t%b\t%b", out2, in2, en2);
#1 en2 = 'bzz;
$strobe("%v \t%b\t%b", out2, in2, en2);

#1 in2 = 'b11;
en2 = 1'b00;
$strobe("%v \t%b\t%b", out2, in2, en2);
#1 en2 = 'b11;
$strobe("%v \t%b\t%b", out2, in2, en2);
#1 en2 = 'bxx;
$strobe("%v \t%b\t%b", out2, in2, en2);
#1 en2 = 'bzz;
$strobe("%v \t%b\t%b", out2, in2, en2);

#1 in2 = 'bxx;
en2 = 'b00;
$strobe("%v \t%b\t%b", out2, in2, en2);
#1 en2 = 'b11;
$strobe("%v \t%b\t%b", out2, in2, en2);
#1 en2 = 'bxx;
$strobe("%v \t%b\t%b", out2, in2, en2);
#1 en2 = 'bzz;
$strobe("%v \t%b\t%b", out2, in2, en2);

#1 in2 = 'bzz;
en2 = 'b00;
$strobe("%v \t%b\t%b", out2, in2, en2);
#1 en2 = 'b11;
$strobe("%v \t%b\t%b", out2, in2, en2);
#1 en2 = 'bxx;
$strobe("%v \t%b\t%b", out2, in2, en2);
#1 en2 = 'bzz;
$strobe("%v \t%b\t%b", out2, in2, en2);
#1;
end
endmodule



